package cn.com.tarotframework.server.oauth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * copyright (C), 2022, 塔罗牌基础架构
 *
 * @program: tarot-core
 * @description: 登录用户信息传参实体类
 * @author: Jiang Xincan
 * @date: 2024/01/20 17:43
 * @version: 0.0.1
 **/
@Schema(name = "用户密码登录DTO", description = "根据用户名称、密码登录")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LoginDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 5364614538134353593L;

    @Schema(name = "account", description = "登录名称", type = "String", defaultValue = "tarot")
    @NotNull(message = "登录名称不能为空")
    @Size(message = "登录名称长度在{min}~{max}之间", min = 5, max = 20)
    private String account;

    @Schema(name = "password", description = "登录密码", type = "String", defaultValue = "123456")
    @NotNull(message = "登录密码不能为空")
    @Size(message = "登录密码长度在{min}~{max}之间", min = 5, max = 20)
    private String password;
}
